1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method for processing an image captured by a video camera or a digital camera, and more particularly to gradation correction of an image obtained by image-capturing.
2. Description of the Related Art
A conventional imaging apparatus such as a video camera or a digital camera obtains an image signal by using an image sensor such as a charge-coupled device (CCD) or a complementary metal-oxide semiconductor (CMOS). In such an image sensor, a range of gradation expression from black to white levels is narrow, and hence the obtained image signal cannot adequately express a gradation range of an image of a real object.
In a system that digitizes the image signal to record the signal, the gradation range is further restricted to an expression range of a digital signal. In order to solve this problem, knee processing is commonly performed, which widens the gradation range to be expressed by compressing a gradation of a high luminance area of the image signal.
Referring to FIG. 14, input/output characteristics and a gradation range of the knee processing will be described. In FIG. 14, a horizontal axis indicates a value of an input signal, while a vertical axis indicates a value of an output signal after the knee processing. Each straight line indicates input/output characteristics when the knee processing is changed.
When no knee processing is performed, input/output characteristic is expressed by a straight line a, and input/output signal values are equal to each other. In other words, a range of an input signal value Ia is equal to that of an output signal value Oa.
When knee processing is performed, the input/output characteristics change from the state of the straight line a to that of a straight-line b or a straight-line c. When the input/output characteristics are in the state of the straight-line b, until an input signal value Ib, as in the case of no knee processing, input/output signal values are equal to each other.
On the other hand, in a high luminance area where an input signal value is equal to or more than the value Ib, a gradation of an output signal value is compressed and, as overall characteristics, a range of input signal values 0 to Ia is compressed to that of output signal values 0 to Ob.
Similarly, in the state of the straight line c, in a high luminance area of the value Ic or more, a gradation of an output signal is compressed and, as a whole, a range of input signal values 0 to Ia is compressed to that of output signal values 0 to Ic.
The application of the knee processing compresses the input signal values, resulting in a wider gradation range to be substantially expressed. Starting points kb and kc of broken lines in the characteristics are referred to as knee points, and a tilt equal to or more than the knee point is referred to as a knee slope. Generally, when the knee processing is strengthened, the knee point is lowered or the knee slope is made flat.
Through such knee processing, a gradation range is corrected for an image of an object in a backlight state or an image with a high luminance object. Depending on a state of the image of the object, a correction amount, i.e., knee strength, is set.
Japanese Patent Application Laid-Open No. 02-033265 discusses a method for setting knee strength by detecting an average value and a peak value for each field or frame and adding these values together at an appropriate ratio. Japanese Patent Application Laid-Open No. 03-204281 discusses a method for setting knee strength by using luminance signal levels obtained from a plurality of areas set on a screen.
However, the method discussed in Japanese Patent Application Laid-Open No. 02-033265 uses the average value and a maximum value of the entire screen. Hence, when a high luminance level causes overexposure in a certain area of the screen, appropriate detection cannot be performed.
The method discussed in Japanese Patent Application Laid-Open No. 03-204281 sets the knee strength by setting the plurality of areas on the screen. However, the screen includes various areas in which overexposure may occur. Hence, setting of an appropriate detection area is difficult.
Neither of Japanese Patent Application Laid-Open Nos. 02-033265 and 03-204281 has no reference to a case where a detection area to be set is made smaller.